package br.com.DoceMagia.view.Usuario;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.border.LineBorder;
import java.awt.Color;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.ImageIcon;
import javax.swing.UIManager;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JSeparator;
import javax.swing.JCheckBox;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Usuario extends JFrame {

	private JPanel contentPane;
	private final JPanel panel_1 = new JPanel();
	private JTextField txtNameUser;
	private JTextField txtLogin;
	private JPasswordField txtUserPass;
	private JPasswordField txtUserPassConfirm;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Usuario frame = new Usuario();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Usuario() {
		setResizable(false);
		setForeground(UIManager.getColor("nimbusFocus"));
		setTitle("Cadastro de Usu\u00E1rio - Agenda Doce Magia - v.2.0");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel.setBounds(0, 40, 444, 232);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JLabel lblNome = new JLabel("Nome:");
		lblNome.setBounds(6, 43, 55, 16);
		panel.add(lblNome);
		
		txtNameUser = new JTextField();
		txtNameUser.setBounds(65, 37, 365, 28);
		panel.add(txtNameUser);
		txtNameUser.setColumns(10);
		
		JLabel lblLogin = new JLabel("Login:");
		lblLogin.setBounds(6, 71, 55, 16);
		panel.add(lblLogin);
		
		txtLogin = new JTextField();
		txtLogin.setBounds(65, 65, 365, 28);
		panel.add(txtLogin);
		txtLogin.setColumns(10);
		
		JLabel lblSenha = new JLabel("Senha: ");
		lblSenha.setBounds(6, 99, 55, 16);
		panel.add(lblSenha);
		
		txtUserPass = new JPasswordField();
		txtUserPass.setBounds(65, 93, 122, 28);
		panel.add(txtUserPass);
		txtUserPass.setColumns(10);
		
		JLabel lblConfirmeASenha = new JLabel("Confirme a senha: ");
		lblConfirmeASenha.setBounds(191, 99, 122, 16);
		panel.add(lblConfirmeASenha);
		
		txtUserPassConfirm = new JPasswordField();
		txtUserPassConfirm.setBounds(301, 93, 129, 28);
		panel.add(txtUserPassConfirm);
		txtUserPassConfirm.setColumns(10);
		
		JSeparator separator = new JSeparator();
		separator.setBounds(6, 127, 432, 7);
		panel.add(separator);
		
		JButton btnNovoCadastro = new JButton("Novo Cadastro");
		btnNovoCadastro.setHorizontalAlignment(SwingConstants.LEFT);
		btnNovoCadastro.setIcon(new ImageIcon("C:\\workspace\\estudo\\AgendaDoceMagiaView\\imagens\\NovoUsuario.png"));
		btnNovoCadastro.setBackground(new Color(214, 217, 223));
		btnNovoCadastro.setBounds(6, 180, 146, 35);
		panel.add(btnNovoCadastro);
		
		JButton btnSaveUser = new JButton("   Salvar");
		btnSaveUser.setBackground(UIManager.getColor("nimbusLightBackground"));
		btnSaveUser.setHorizontalAlignment(SwingConstants.LEFT);
		btnSaveUser.setIcon(new ImageIcon("C:\\workspace\\estudo\\AgendaDoceMagiaView\\imagens\\salvarUsuario.png"));
		btnSaveUser.setBackground(new Color(214, 217, 223));
		btnSaveUser.setBounds(164, 180, 125, 35);
		panel.add(btnSaveUser);
		
		JButton btnCancelUser = new JButton("  Cancelar");
		btnCancelUser.setIcon(new ImageIcon("C:\\workspace\\estudo\\AgendaDoceMagiaView\\imagens\\cancelarUsuario.png"));
		btnCancelUser.setBackground(new Color(214, 217, 223));
		btnCancelUser.setHorizontalAlignment(SwingConstants.LEFT);
		btnCancelUser.setBounds(301, 180, 129, 35);
		panel.add(btnCancelUser);
		panel_1.setBackground(Color.WHITE);
		panel_1.setBounds(0, 0, 444, 37);
		contentPane.add(panel_1);
		panel_1.setLayout(null);
		
		JLabel lblUsuario = new JLabel("Usu\u00E1rio");
		lblUsuario.setIcon(new ImageIcon("C:\\workspace\\estudo\\AgendaDoceMagiaView\\imagens\\usuario.png"));
		lblUsuario.setBounds(6, 6, 123, 30);
		lblUsuario.setFont(new Font("Calibri", Font.BOLD | Font.ITALIC, 24));
		panel_1.add(lblUsuario);
	}
}
